package com.sunday.framework.dto;

import com.sunday.common.core.gson.GsonUtils;
import com.sunday.common.core.remoting.base.auth.BaseDTO;
import com.sunday.redisson.annotation.OpenDistributedLock;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * @Description: 角色表 请求 DTO
 * @author: zsy
 * @Create: 2022/11/07 16:21:05
 */
@Data
public class UpdateRoleReqDTO extends BaseDTO {

    /**
     * 主键
     */
    @NotNull
    @Positive
    @OpenDistributedLock("sunday_role")
    private Long id;

    /**
     * 名称
     */
    @NotBlank
    @Size(min = 1, max = 50)
    private String name;


    @Override
    public String toString() {
        return GsonUtils.DEFAULT.toJson(this);
    }

}
